/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author innovapps.co
 */
@Entity
@Table(name = "detalle_informe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleInforme.findAll", query = "SELECT d FROM DetalleInforme d"),
    @NamedQuery(name = "DetalleInforme.findByIdDetalleInforme", query = "SELECT d FROM DetalleInforme d WHERE d.idDetalleInforme = :idDetalleInforme"),
    @NamedQuery(name = "DetalleInforme.findByAreaNominal", query = "SELECT d FROM DetalleInforme d WHERE d.areaNominal = :areaNominal"),
    @NamedQuery(name = "DetalleInforme.findByCargaMax", query = "SELECT d FROM DetalleInforme d WHERE d.cargaMax = :cargaMax"),
    @NamedQuery(name = "DetalleInforme.findByResistencia", query = "SELECT d FROM DetalleInforme d WHERE d.resistencia = :resistencia"),
    @NamedQuery(name = "DetalleInforme.findByFormaFalla", query = "SELECT d FROM DetalleInforme d WHERE d.formaFalla = :formaFalla")})
public class DetalleInforme implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_detalle_informe")
    private Integer idDetalleInforme;
    @Basic(optional = false)
    @Column(name = "area_nominal")
    private float areaNominal;
    @Basic(optional = false)
    @Column(name = "carga_max")
    private float cargaMax;
    @Basic(optional = false)
    @Column(name = "resistencia")
    private float resistencia;
    @Basic(optional = false)
    @Column(name = "forma_falla")
    private String formaFalla;
    @JoinColumn(name = "informe_soldadura_id_informe_soldadura", referencedColumnName = "id_informe_soldadura")
    @ManyToOne(optional = false)
    private InformeSoldadura informeSoldaduraIdInformeSoldadura;

    public DetalleInforme() {
    }

    public DetalleInforme(Integer idDetalleInforme) {
        this.idDetalleInforme = idDetalleInforme;
    }

    public DetalleInforme(Integer idDetalleInforme, float areaNominal, float cargaMax, float resistencia, String formaFalla) {
        this.idDetalleInforme = idDetalleInforme;
        this.areaNominal = areaNominal;
        this.cargaMax = cargaMax;
        this.resistencia = resistencia;
        this.formaFalla = formaFalla;
    }

    public Integer getIdDetalleInforme() {
        return idDetalleInforme;
    }

    public void setIdDetalleInforme(Integer idDetalleInforme) {
        this.idDetalleInforme = idDetalleInforme;
    }

    public float getAreaNominal() {
        return areaNominal;
    }

    public void setAreaNominal(float areaNominal) {
        this.areaNominal = areaNominal;
    }

    public float getCargaMax() {
        return cargaMax;
    }

    public void setCargaMax(float cargaMax) {
        this.cargaMax = cargaMax;
    }

    public float getResistencia() {
        return resistencia;
    }

    public void setResistencia(float resistencia) {
        this.resistencia = resistencia;
    }

    public String getFormaFalla() {
        return formaFalla;
    }

    public void setFormaFalla(String formaFalla) {
        this.formaFalla = formaFalla;
    }

    public InformeSoldadura getInformeSoldaduraIdInformeSoldadura() {
        return informeSoldaduraIdInformeSoldadura;
    }

    public void setInformeSoldaduraIdInformeSoldadura(InformeSoldadura informeSoldaduraIdInformeSoldadura) {
        this.informeSoldaduraIdInformeSoldadura = informeSoldaduraIdInformeSoldadura;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleInforme != null ? idDetalleInforme.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleInforme)) {
            return false;
        }
        DetalleInforme other = (DetalleInforme) object;
        if ((this.idDetalleInforme == null && other.idDetalleInforme != null) || (this.idDetalleInforme != null && !this.idDetalleInforme.equals(other.idDetalleInforme))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.DetalleInforme[ idDetalleInforme=" + idDetalleInforme + " ]";
    }
}
